package com.crl.rcdp.common.dao;

import com.cars.util.bean.ComboboxVO;
import com.crl.dao.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description:
 * @author: 孔垂云
 * @version: 1.0
 * @date: 2020/7/23 23:10
 */
@Repository
public class CommonComboDao extends BaseDao<ComboboxVO, ComboboxVO> {

    /**
     * 代码生成器中用户列表
     *
     * @return
     */
    public List<ComboboxVO> listGenAuthor() {
        String sql = "select author_name label,id value from td_gen_config order by id";
        return list(sql);
    }

    /**
     * 代码生成器中用户列表
     *
     * @return
     */
    public List<ComboboxVO> listGenTable(int authorId) {
        String sql = "select tablename label,id value from td_gen_table where author_id=?";
        return list(sql, authorId);
    }

    /**
     * 接口类型列表
     *
     * @return
     */
    public List<ComboboxVO> listApitype() {
        String sql = "select name label,id value from td_sys_apitype order by id";
        return list(sql);
    }
}
